package com.meelive.ingkee.push.model;

import android.text.TextUtils;

import java.io.Serializable;

/**
 * Create by: fanfeiyue
 * on: 2019-08-22
 * desc:
 */
public enum InkePushType implements Serializable {
    MIPUSH("MI"),
    HMSPUSH("HUAWEI"),
    MEIZUPUSH("MEIZU"),
    OPPOPUSH("OPPO"),
    VIVOPUSH("VIVO"),
    JPUSH("JPUSH");

    private String name;

    InkePushType(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static InkePushType getType(String name) {
        if (TextUtils.isEmpty(name)) {
            return JPUSH;
        } else {
            InkePushType[] types = values();
            int len = types.length;

            for (int i = 0; i < len; ++i) {
                InkePushType type = types[i];
                if (type.getName().equals(name)) {
                    return type;
                }
            }

            return JPUSH;
        }
    }
}
